!function () {
    try {
        define("Tpl/Public/loginRegV3", function () {
            $(function () {
                function e() {
                    $(".areaCode-con , .areaCode-icon").on("click", function () {
                        var e = $(".areaCode-select");
                        "none" == e.css("display") ? e.css("display", "block") : e.css("display", "")
                    }), $(".areaCode-select").find("p").on("click", function () {
                        $(".warning-text").empty(), $("#phone").removeClass("danger"), $(".areaCode-con").find("p").html($(this).html()), $("#areaCode").val($(".areaCode-con").find("i").html());
                        var e = $(".areaCode-con").find("p").text(), n = e.substring(0, e.indexOf("+"));
                        $("#country_name").val(n), $(this).parent().css("display", "")
                    }), $(document).on("click", function (e) {
                        var n = $(".areaCode-select");
                        if ("none" != n.css("display")) {
                            var e = e || window.event, a = e.target || e.srcElement,
                                t = a.parentNode.parentNode.getAttribute("class");
                            "areaCode" == t || "areaCode-con" == t || "input-inline" == t ? n.css("display", "block") : n.css("display", "")
                        }
                    })
                }

                var n = $(".areaCode-con").find("p").text(), a = n.substring(0, n.indexOf("+"));
                $("#areaCode").val($(".areaCode-con").find("i").html()), $("#country_name").val(a), $(".j-phoneLogin,.j-accountLogin").on("click", function () {
                    $.ajax({
                        type: "post",
                        url: "/index.php?m=userinfo&a=getSmsAreaCode",
                        data: {},
                        async: !1,
                        dataType: "json",
                        success: function (e) {
                            if (1 == e.status) {
                                var n = "";
                                $.each(e.data, function (e, a) {
                                    n += "<p>" + a.country + "<i>+" + a.code + "</i></p>"
                                }), $(".areaCode-select").html(n)
                            }
                        }
                    }), e(), $("#img-captcha").click(function () {
                        $(this).attr("src", "/index.php?m=userinfo&a=getImgCaptch&v=" + (new Date).getTime())
                    }), $("#img-captcha2").click(function () {
                        $(this).attr("src", "/index.php?m=userinfo&a=getImgCaptch&v=" + (new Date).getTime())
                    });
                    var n = $(this).closest(".login-wrap");
                    n.find(".phone-box,.account-box").hide(), $(this).hasClass("j-phoneLogin") ? ("" == $("#img-captcha").attr("src") && $.post("/index.php?m=userinfo&a=getImgCaptchStatus", {}, function (e) {
                        1 == e.imgStatus ? (t.imgCodeStatus = 1, $("#sendcode-captcha").css("display", "none")) : (t.imgCodeStatus = 0, $("#img-captcha").click(), $("#sendcode-captcha").css("display", "block"))
                    }, "json"), n.find(".phone-box").show()) : n.find(".account-box").show(), n.find(".login-footer").is(":hidden") || (n.find(".login-footer").hide(), n.find(".login-others").stop().animate({marginTop: "-100px"}, 200, "linear", function () {
                        $(this).attr("class", "login-others-cards").removeAttr("style"), n.find(".login-box").fadeIn(300)
                    }))
                }), $(".login-form .login-switch .j-phoneLogin").on("click", function () {
                    e()
                });
                var t = {
                    phoneRule: /^1[3456789]\d{9}$/,
                    isPhone: 0,
                    isCode: 0,
                    isAccount: 0,
                    isPasswd: 0,
                    imgCodeStatus: 0,
                    init: function () {
                        var e = this;
                        $(".login-content input").focus(function () {
                            $(this).css("color", "#666"), $(this).removeClass("danger"), $(this).nextAll(".warning-text").removeClass("show")
                        }).blur(function () {
                            var n = $(this).attr("id");
                            switch (n) {
                                case"phone":
                                    e.getErrorInfo("#phone", e.checkPhone());
                                    break;
                                case"captcha":
                                    e.getErrorInfo("#captcha", e.checkCaptcha());
                                    break;
                                case"account":
                                    e.getErrorInfo("#account", e.checkAccount());
                                    break;
                                case"passwd":
                                    e.getErrorInfo("#passwd", e.checkPasswd())
                            }
                        }), $(".btn-captcha").click(function () {
                            e.checkEnroll()
                        }), $("#captcha").keydown(function (e) {
                            "13" == e.which && ($("#captcha").blur(), $("#submit-phone").click())
                        }), $("#passwd").keydown(function (e) {
                            "13" == e.which && ($("#passwd").blur(), $("#submit-passwd").click())
                        }), $(document).on("click", "#submit-phone", function () {
                            return e.getErrorInfo("#phone", e.checkPhone()) && e.getErrorInfo("#captcha", e.checkCaptcha()) ? void e.loginByPhone() : !1
                        }), e.loginByAccount()
                    },
                    loginByPhone: function () {
                        var e = $("#phone").val(), n = $("#captcha").val(), a = $("#areaCode").val();
                        $.post("/index.php?m=userinfo&a=loginByCodeNew", {
                            username: e,
                            userpass: n,
                            areaCode: a
                        }, function (e) {
                            2 == e.status ? t.getErrorInfo("#captcha", e.info) : 0 == e.status ? t.getErrorInfo("#phone", e.info) : 1 == e.status && (e.data ? location.href = e.data : location.reload())
                        }, "json")
                    },
                    loginByAccount: function () {
                        var e = this;
                        $("#submit-passwd").click(function () {
                            if (!e.getErrorInfo("#account", e.checkAccount()))return !1;
                            if (!e.getErrorInfo("#passwd", e.checkPasswd()))return !1;
                            var n = $("#account").val(), a = $("#passwd").val(), o = $("#areaCode").val();
                            $.post("/index.php?m=userinfo&a=loginByPasswdNew", {
                                username: n,
                                userpass: a,
                                imgCode: $("#img-code2").val(),
                                areaCode: o
                            }, function (e) {
                                e.data >= 3 && 1 != e.status && ($(".account-captcha").css("display", "block"), $("#submit-phone").addClass("disabled"), $("#img-captcha2").click()), 2 == e.status ? t.getErrorInfo("#account", e.info) : 0 == e.status ? t.getErrorInfo("#passwd", e.info) : 1 == e.status ? e.data ? location.href = e.data : location.reload() : 4 == e.status && t.getErrorInfo("#img-code2", e.info)
                            }, "json")
                        })
                    },
                    checkLogin: function () {
                        return this.isPhone && this.isCode ? 1 : this.isAccount && this.isPasswd ? 2 : !1
                    },
                    checkAccount: function () {
                        var e = $("#account").val();
                        return t.isAccount = 0, "" == e ? ($("#submit-passwd").addClass("disabled"), "帐号不能为空!") : (t.isAccount = 1, 2 == t.checkLogin() && $("#submit-passwd").removeClass("disabled"), !1)
                    },
                    checkPasswd: function () {
                        var e = $("#passwd").val();
                        return t.isPasswd = 0, "" == e ? ($("#submit-passwd").addClass("disabled"), "密码不能为空!") : (t.isPasswd = 1, 2 == t.checkLogin() && $("#submit-passwd").removeClass("disabled"), !1)
                    },
                    checkPhone: function () {
                        var e = $("#phone").val();
                        if (t.isPhone = 0, "" == e)return $("#submit-phone").addClass("disabled"), "手机号不能为空!";
                        if (isNaN(e))return $("#submit-phone").addClass("disabled"), "请输入数字!";
                        var n = $("#country_name").val();
                        if ("中国" == n) {
                            if (!this.phoneRule.test(e))return $("#submit-phone").addClass("disabled"), "手机号格式错误!"
                        } else if ("美国" == n || "法国" == n || "英国" == n || "澳大利亚" == n) {
                            if (e.length > 10)return $("#submit-phone").addClass("disabled"), "手机号格式错误!"
                        } else if ("新加坡" == n && e.length > 8)return $("#submit-phone").addClass("disabled"), "手机号格式错误!";
                        return t.isPhone = 1, 1 == t.checkLogin() && $("#submit-phone").removeClass("disabled"), !1
                    },
                    checkCaptcha: function () {
                        var e = $("#captcha").val(), n = /^\d{6}$/;
                        return "" == e ? (t.isCode = 0, $("#submit-phone").addClass("disabled"), "验证码不能为空!") : n.test(e) ? (t.isCode = 1, 1 == t.checkLogin() && $("#submit-phone").removeClass("disabled"), !1) : (t.isCode = 0, $("#submit-phone").addClass("disabled"), "验证码应为6位数字!")
                    },
                    captchaKeyUp: function () {
                        var e = /^\d{6}$/;
                        $("#captcha").keyup(function () {
                            var n = $(this).val();
                            if (e.test(n)) {
                                if (t.isCode = 1, t.checkLogin())return t.getErrorInfo("#captcha", !1), void $("#submit-phone").removeClass("disabled")
                            } else t.isCode = 0, $("#submit-phone").addClass("disabled")
                        })
                    }(),
                    getErrorInfo: function (e, n) {
                        if (n) {
                            this.getErrorInfo($(".login-content input"), !1);
                            var n = "<span><i class='danger-icon'></i>  " + n + "</span>";
                            return $(e).addClass("danger").nextAll(".warning-text").html(n).addClass("show"), !1
                        }
                        return $(e).removeClass("danger").nextAll(".warning-text").removeClass("show"), !0
                    },
                    sendCode: function (e) {
                        $.post("/index.php?m=userinfo&a=sendCode", {
                            phone: e,
                            sms_tpl: "login",
                            imgCode: $("#img-code").val(),
                            areaCode: $("#areaCode").val()
                        }, function (e) {
                            1 == e.status ? (t.getErrorInfo("#phone", !1), t.captchaChange()) : 2 == e.status ? (1 == t.imgCodeStatus ? (t.getErrorInfo("#img-captcha", "请输入图形验证码!"), t.imgCodeStatus = 0, $("#sendcode-captcha").css("display", "block")) : t.getErrorInfo("#img-captcha", e.info), $("#img-captcha").click()) : 4 == e.status ? (t.getErrorInfo("#img-captcha", e.info), $("#img-captcha").click()) : void 0 != e.info && (t.getErrorInfo("#phone", e.info), $("#img-captcha").click())
                        }, "json")
                    },
                    time: 60,
                    captchaChange: function () {
                        var e = $(".btn-captcha a");
                        60 == t.time && e.parent().addClass("disabled"), 0 == t.time ? (t.time = 60, e.html("重新发送"), e.parent().removeClass("disabled")) : (e.html(t.time + "s"), t.time--, setTimeout(function () {
                            t.captchaChange()
                        }, 1e3))
                    },
                    checkImgCaptcha: function () {
                        if (1 == t.imgCodeStatus)return !1;
                        var e = $("#img-code").val(), n = /^[a-zA-Z]{4}$/;
                        return "" == e ? "图形验证码不能为空!" : n.test(e) ? !1 : "图形验证码应为4位字母!"
                    },
                    checkEnroll: function () {
                        if (!t.getErrorInfo("#img-code", t.checkImgCaptcha()))return !1;
                        if (t.checkPhone())return t.getErrorInfo("#phone", t.checkPhone()), !1;
                        var e = $("#phone").val();
                        $.ajax({
                            type: "post",
                            url: "/index.php?m=userinfo&a=checkPhone",
                            data: {phone: e},
                            async: !1,
                            dataType: "json",
                            success: function (n) {
                                if ("2" == n.status) {
                                    var a = '该帐号还未注册，<a href="http://www.58pic.com/index.php?m=loginNew&a=enroll" class="text-green">去注册</a>';
                                    t.getErrorInfo("#phone", a), t.isPhone = 0
                                } else t.sendCode(e), t.isPhone = 1
                            }
                        })
                    }
                };
                t.init(), $("#top-login").click(function () {
                    $(".login-prompt").css("display", "none"), $(".login-model").show()
                }), $(".agreement-handle").click(function () {
                    $("body").append('<div class="agreement-handle-message" style=" font-size: 14px;\ndisplay: none;line-height: 1.5;\npadding: 20px 30px;border-radius: 4px;-webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);background: #fff;color: rgba(0, 0, 0, 0.65);\nlist-style: none;\nposition: fixed;\nz-index: 1010;\nmargin-left: -138px;top: 16px;\nleft: 50%;"><img src="http://icon.qiantucdn.com/images/warning-icon.png" style="display: inline-block;vertical-align: middle;margin-right: 15px">登录/注册必须同意该协议</div>'), $(".agreement-handle-message").fadeIn(), setTimeout(function () {
                        $(".agreement-handle-message").fadeOut(), $(".agreement-handle-message").remove()
                    }, 3e3)
                })
            })
        })
    } catch (e) {
    }
}();
!function () {
    try {
        define("Tpl/Public/rightBtnV2", function () {
            function t() {
                $.ajax({
                    url: "http://ajax.58pic.com/58pic/index.php?m=tongji&a=tongjiActivityResume&data=h5-2",
                    dataType: "jsonp",
                    type: "get"
                })
            }

            function e(e) {
                var a = "h5Zt=1", i = document.cookie.indexOf(a);
                -1 != i ? $(".popupH5").css("display", "") : (t(), $(".popupH5").css("display", "block"), 1 == e && (a += "; expires=Fri, 31 Dec 9999 23:59:59 GMT", document.cookie = a))
            }

            function a() {
                var t = new Date, e = t.getDate(), a = t.getMonth() + 1;
                if (a >= 9) $(".activityBottomPopup").css("display", "block"); else if (8 == a && 25 > e) $(".activityBottomPopup").css("display", "none"); else {
                    $(".activityBottomPopup").css("display", "block");
                    var i = localStorage.getItem("myDay");
                    31 == e && (e = 0), e >= i ? $(".activityBottomPopup").css("display", "block") : $(".activityBottomPopup").css("display", "none"), a >= 9 && e >= 27 && $(".activityBottomPopup").css("display", "none")
                }
                var n = localStorage.getItem("events");
                e >= n ? $(".eventBottomPopup").css("display", "block") : $(".eventBottomPopup").css("display", "none")
            }

            $(function () {
                function t() {
                    $(".notice-sign-over").fadeOut(2e3), $(".notice-sign-over").find("ul").eq(1).addClass("integral-animation2")
                }

                function e(t) {
                    var e = arguments[1] ? arguments[1] : "";
                    t = t || "", $(".everySign").html();
                    var a = cookie("auth_id");
                    if ("" == a)return $("#loginBtn").click(), !1;
                    "" == i ? $.get("http://www.58pic.com/index.php?m=signin&a=getActivitySignMessage", function (t) {
                        1 == t.status && (i = t.message, $(".everySign").html(i), $("#cycleHidden").val(t.one), $("#weekHidden").val(t.four), $("#start_timeHidden").val(t.two), $("#end_timeHidden").val(t.three), "lottery-sign" == e && $(".integral-btn").addClass("lottery-sign-reload"))
                    }, "json") : ($(".everySign .integral-model2").removeClass("integral-animation2"), $(".everySign").html(i));
                    var n = $("#cycleHidden").val(), l = ($("#weekHidden").val(), $("#isNoticeSign").val());
                    if ("undefined" != typeof l && 0 != l)var s = base64.encode(l); else var s = base64.encode(0);
                    $.get("http://www.58pic.com/index.php?m=signin&a=getUserSignM&cycle=" + n + "&sign=" + s + "&time=" + (new Date).getTime(), function (e) {
                        if (0 == e.is_click) {
                            var a = "签到有礼";
                            if (0 == e.click_num) $(".integral-get-display1").addClass("integral-agency"); else {
                                for (var i = 1; i <= e.click_num; i++)$(".integral-get-display" + i).addClass("integral-get");
                                var n = parseInt(e.click_num) + 1;
                                $(".integral-get-display" + i).addClass("integral-agency")
                            }
                            $(".integral-btn").removeClass("disable")
                        } else {
                            for (var a = "今日已签到", i = 1; i <= e.click_num; i++)$(".integral-get-display" + i).addClass("integral-get");
                            var n = parseInt(e.click_num) + 1;
                            0 == e.week && 7 != n ? ($(".everySign .integral-btn").addClass("disable"), $(".everySign .integral-btn").text("已签到")) : ($(".integral-get-display" + n).addClass("integral-tomorrow"), $(".everySign .integral-btn").addClass("disable"), $(".everySign .integral-btn").text("已签到")), $(".everySign .integral-btn").css("pointer-events", "none").css("background", "#cccccc !important"), $(".integral-btn").hide(), $(".integral-link").show(), $(".integral-over").show()
                        }
                        $(".everySign .integral-nav").addClass("integral-nav-display" + e.click_num), 1 == e.whichT ? ($(".integral-background2").show(), $(".integral-title").html("欢迎来到千图网"), $(".integral-explain").html("积分、VIP免费领取，每周更新签到好礼，常来哦")) : 7 == e.whichT ? ($(".integral-background2").show(), $(".integral-title").html("签到提醒"), $(".integral-explain").html("签到领积分，iPhoneX手绘板等你换！")) : ($(".integral-title").html(a), $(".integral-explain").html("已签到" + e.click_num + "天，" + e.rewardThing)), 1 == t && $(".integral-background2").show()
                    }, "json")
                }

                function a() {
                    var t = $(window).scrollTop(), e = $(".tally"), a = $(".tally-a5,.tally-a6"),
                        i = $(window).height();
                    824 >= i && 0 == t && e.css("display", "none"), t > 0 && 1500 > t && (e.css("display", "block"), a.css("display", "none")), t > 1500 && (e.css("display", "block"), a.css("display", "block"))
                }

                $(document).on("click", ".integral-close2,.integral-over", function () {
                    $(".everySign .integral-back5").fadeOut(2e3), $(".everySign .integral-model2").addClass("integral-animation2"), $(".everySign .integral-background2").hide();
                    var t = $("#isNoticeSign").val();
                    if ("undefined" != typeof t && 0 != t)var e = base64.encode(t); else var e = base64.encode(0);
                    $.post("?m=signin&a=closeSignNotice", {sign: e}, function () {
                    })
                }), $(document).on("click", ".integral-close", function () {
                    $(".notice-sign-over").fadeOut(2e3), $(".notice-sign-over").find("ul").eq(1).addClass("integral-animation2")
                });
                var i = "";
                $(document).on("click", ".integral-btn", function () {
                    var e = $(this), a = $("#cycleHidden").val(), i = $("#isNoticeSign").val();
                    if ("undefined" != typeof i && 0 != i)var n = base64.encode(i); else var n = base64.encode(0);
                    var l = base64.encode($("#start_timeHidden").val()), s = base64.encode($("#end_timeHidden").val());
                    $.post("http://www.58pic.com/index.php?m=signin&a=addUserSign&time=" + (new Date).getTime(), {
                        cycle: a,
                        start_time: l,
                        end_time: s,
                        sign: n
                    }, function (a) {
                        if (1 == a.status || 2 == a.status) {
                            if ($(".everySign .integral-back5").hide(), 1 == a.type) {
                                var i = "qtb";
                                $(".integral-txt2").text("恭喜获得" + a.times + "积分")
                            } else if (2 == a.type) {
                                var i = "gx";
                                $(".integral-txt2").text("恭喜获得共享VIP" + a.times + "天")
                            } else if (3 == a.type) {
                                var i = "yc";
                                $(".integral-txt2").text("恭喜获得原创VIP" + a.times + "天")
                            } else if (4 == a.type) {
                                var i = "bg";
                                $(".integral-txt2").text("恭喜获得办公VIP" + a.times + "天")
                            } else if (5 == a.type) {
                                var i = "all";
                                $(".integral-txt2").text("恭喜获得全站VIP" + a.times + "天(共享+原创+办公)")
                            }
                            $(".integral-txt3").text(), $(".integral-btn").addClass("disable"), $(".integral-btn").find("a").text("已签到"), $(".tally .tally-a1").html("<i class='tally-i1'></i>已签到"), $(".integral-txt3").html(a.rewardThing), $(".tally-ul5").css("display", "none"), $(".tally-ul4").css("display", "none"), $(".tally-a10").hide(), $(".integral-img-" + i).show(), $(".notice-sign-over").show(), setInterval(t, 1e3), $(e).hasClass("lottery-sign-reload") && document.location.reload()
                        } else 0 == a.status || 3 == a.status && ($(".everySign .integral-back5").hide(), alert("您已经签到过了，明天继续！"))
                    }, "json")
                });
                var n = "", l = !1;
                $(".tally").on("mouseenter", ".tally-a1", function () {
                    var t = cookie("auth_id");
                    "" == t ? $(".tally-a7").find("em").text("任务中心") : l ? ("" == n && (n = 0), $(".tally-a7").find("em").text(n + "积分")) : (l = !0, $.post("http://www.58pic.com/index.php?m=IntegralMall&a=getUserQtb&time=" + (new Date).getTime(), function (t) {
                        1 == t.status && (n = t.qtb, $(".tally-a7").find("em").text(n + "积分"))
                    }, "json"))
                });
                var s = $("#isNoticeSign").val();
                "undefined" != typeof s && 0 != s && e(1), $(".login-a,.every-day-sign,.sign-but,.lottery-sign").on("click", function () {
                    var t = $(this).attr("class");
                    e(0, t)
                }), $(document).on("click", "model-table-know,.btn-know", function () {
                    $("#qt-model-t").hide(), $("#qt-model-sign").hide(), $(".every-day-sign").hide()
                }), $(document).on("click", ".sign-alert,.every-day-sign", function (t) {
                    t.stopPropagation()
                }), $(document).on("click", "#qt-model-sign .sign-new", function (t) {
                    t.stopPropagation()
                }), $(document).on("click", ".model-table-call", function () {
                    $("#qt-model-sign").hide(), $(".sign-alert").hide()
                }), $(".tally-a1").mouseover(function () {
                    $(".tally-ul1").css("display", "block")
                }), $(".tally-a1").mouseout(function () {
                    $(".tally-ul1").css("display", "")
                }), $(".tally-ul1").mouseover(function () {
                    $(this).css("display", "block"), $(".tally-a1").attr("class", "tally-a1 tally-aa1")
                }), $(".tally-ul1").mouseout(function () {
                    $(this).css("display", ""), $(".tally-a1").attr("class", "tally-a1")
                }), $(".tally-a2").mouseover(function () {
                    $(".tally-ul2").css("display", "block")
                }), $(".tally-a2").mouseout(function () {
                    $(".tally-ul2").css("display", "")
                }), $(".tally-ul2").mouseover(function () {
                    $(this).css("display", "block"), $(".tally-a2").attr("class", "tally-a2 tally-aa2")
                }), $(".tally-ul2").mouseout(function () {
                    $(this).css("display", ""), $(".tally-a2").attr("class", "tally-a2")
                }), $(".tally-a5").mouseover(function () {
                    $(".tally-ul3").css("display", "block")
                }), $(".tally-a5").mouseout(function () {
                    $(".tally-ul3").css("display", "")
                }), $(window).scroll(function () {
                    a()
                }), $(".tally-a6").click(function () {
                    $("html,body").animate({scrollTop: "0"}, 300)
                }), a(), $(".tally-ul5").click(function () {
                    $(".tally-ul4").css("display", "none"), $(this).css("display", "none")
                })
            }), location.href.length <= 22 ? e(0) : $(".popupH5").css("display", ""), $(".popupH5-background, .popupH5-close").on("click", function () {
                e(1), $(".popupH5").css("display", ""), t()
            }), $(".h5Message-con").on("click", function () {
                e(0), $(".popupH5").css("display", "block"), t()
            }), $(".activityBottomPopup-close").on("click", function () {
                $(".activityBottomPopup").css("display", "none");
                var t = (new Date).getDate() + 1;
                32 == t && (t = 1), localStorage.setItem("myDay", t)
            }), $(".eventBottomPopup-close").on("click", function () {
                $(".eventBottomPopup").css("display", "none");
                var t = (new Date).getDate() + 1;
                localStorage.setItem("events", t)
            }), a()
        })
    } catch (t) {
    }
}();
!function () {
    try {
        define("Tpl/Public/favorPage", function () {
            function a(a, t) {
                var i, e = "";
                switch (t) {
                    case 0:
                        e = "", i = '<i class="icon icon-yuanxingxuanzhong"></i>已收藏';
                        break;
                    case 1:
                        e = "rFav", i = '<i class="icon icon-yuanxingxuanzhong"></i>成功';
                        break;
                    case 2:
                        e = "rFav", i = '<i class="icon icon-yichu"></i>移除';
                        break;
                    case 3:
                        e = "", i = '<i class="icon icon-load turnAround"></i>不要急...';
                        break;
                    case 4:
                        e = "addFav", i = '<i class="icon icon-jiahao1"></i>添加'
                }
                a.find(".fav-status").attr("data-action", e).html(i)
            }

            $(".j-model-fav,.j-model-fav-create,.j-model-null").model(), $(".j-close").click(function () {
                $(this).parents(".qt-model-t").hide(), $("body").css("overflow", "initial")
            }), $(".model-table-close,.login-close").click(function () {
                $(this).parents(".qt-model-t").hide(), $("body").css("overflow", "initial")
            }), $(document).on("click", function () {
                $(".model-favirite-all").hide(), $("body").css("overflow", "initial")
            }), $(document).on("click", ".model-favirite-all .model-content", function (a) {
                a.stopPropagation()
            }), $(document).on("mouseenter", "li.fav-list.on .fav-status", function () {
                $(this).closest(".fav-list").hasClass("wait") || a($(this).parent(), 2)
            }), $(document).on("mouseleave", "li.fav-list.on .fav-status", function () {
                $(this).closest(".fav-list").hasClass("wait") || a($(this).parent(), 0)
            }), $(document).on("click", ".handle-fav,.fav-ajax.btn-fav", function (a) {
                if (a.stopPropagation(), a.preventDefault(), $("body").css("overflow", "hidden"), "" == cookie("auth_id"))return $(".login-model").show(), !1;
                $("#favirite-create .edit-warning").remove(), $("#favirite-create").find(".create-alert").remove(), $("#favirite-create .fav-name").val("");
                var t = '<p class="edit-warp create-alert" style="padding-top: 0px">创建后将自动保存在此收藏夹内</p>';
                $("#favirite-create .fav-create").append(t);
                var i = $(this).attr("data-action"), e = $(this).attr("data-id");
                if ($("#favirite-create #add-page").attr("data-id", e), $("#favirite-all").is(":hidden") && "addFav" == i) $.ajax({
                    type: "GET",
                    url: "/index.php?m=favorPage&a=ajaxGetFavorPage&picid=" + e,
                    dataType: "json",
                    success: function (a) {
                        if (0 == a.status)if (0 == a.info) $("#favirite-null").fadeIn(200), $("#favirite-create #add-page").attr("data-id", e); else {
                            $("#favirite-all").attr("data-id", e), parseInt(a.info) / parseInt(a.limit) > 1 ? $("#favirite-all").attr("data-page", 1) : $("#favirite-all").attr("data-page", 0), $("#favirite-all .favirite-box").find("li").remove();
                            for (var t = "", i = a.data, s = 0; s < i.length; s++) {
                                var r = "", n = "", l = "", c = "";
                                $("#h_favorId").length && parseInt($("#h_favorId").val()) == parseInt(i[s].id) ? (l = "(当前收藏夹)", c = "javascript:;") : c = "http://www.58pic.com/c/" + i[s].id, 1 == i[s].isFavor ? (r = "on", n = '<p class="fav-status fav-ajax" data-action="rFav"  data-id="' + i[s].id + '"><i class="icon icon-yuanxingxuanzhong"></i>已收藏</p>') : n = '<p class="fav-status fav-ajax" data-action="addFav" data-id="' + i[s].id + '"><i class="icon icon-jiahao1"></i>添加</p>';
                                var d = "background: url('" + i[s].cover_img + "') 100%;background-size:cover;";
                                t += '<li class="fav-list ' + r + '" data-id="' + i[s].id + '"><a href="javascript:;" target="_blank"><div class="bg" style="' + d + '"></div><p class="h3"><span>' + i[s].pic_num + "</span>个作品" + l + '</p><p class="h1">' + i[s].name + "</p></a>" + n + "</li>"
                            }
                            $("#favirite-all .favirite-box").append(t), $("#favirite-all").fadeIn(200), $("#favirite-all .fav-ajax").attr("data-id", e)
                        } else {
                            var o = "<p>您已收藏该图片</p>";
                            $("#favirite-success .alert-con .icont-true").next().replaceWith(o), $("#favirite-success").fadeIn(200), setTimeout(function () {
                                $("#favirite-success").fadeOut(200)
                            }, 2e3)
                        }
                    }
                }); else {
                    var s = $(this);
                    $.ajax({
                        type: "POST",
                        url: "/index.php?m=user&a=ajaxFav",
                        data: {action: i, picid: e},
                        dataType: "json",
                        success: function (a) {
                            if (1 != a.status) {
                                var t = "<p>您已取消收藏该图片</p>";
                                return $("#favirite-success .alert-con .icont-true").next().replaceWith(t), $("#favirite-success").fadeIn(200), setTimeout(function () {
                                    $("#favirite-success").fadeOut(200)
                                }, 2e3), !1
                            }
                            s.attr("id", a.data.i), s.children().eq(0).removeClass("on"), s.children().eq(1).html(parseInt(s.children().eq(1).html()) - 1)
                        }
                    })
                }
            }), $(document).on("click", ".fav-status.fav-ajax", function (t) {
                t.stopPropagation(), t.preventDefault();
                var i, e = $("#favirite-all .fav-ajax").attr("data-id"),
                    s = $("#favirite-create #add-page").attr("data-id");
                i = "" == e ? s : e;
                var r = $(this).closest(".fav-list").attr("data-id"), n = $("[data-id=" + i + "]").eq(1),
                    l = $(this).attr("data-action");
                if (l) {
                    $(this).closest(".fav-list").addClass("wait"), a($(this).closest(".fav-list"), 3);
                    var c = $(this);
                    return $.ajax({
                        type: "POST",
                        url: "/index.php?m=user&a=ajaxFav",
                        data: {action: l, picid: i, page_id: r},
                        dataType: "json",
                        success: function (t) {
                            if (1 == t.status) "rFav" == t.data.a ? (n.attr("id", t.data.i), a(c.closest(".fav-list"), 1), n.children().eq(0).addClass("on"), c.closest(".fav-list").addClass("on"), c.closest(".fav-list").removeClass("wait"), c.closest(".fav-list").find(".h3 span").text(parseInt(c.closest(".fav-list").find(".h3 span").text()) + 1)) : (n.attr("id", t.data.i), c.closest(".fav-list").removeClass("wait on"), a(c.closest(".fav-list"), 4), c.closest(".fav-list").find(".h3 span").text(parseInt(c.closest(".fav-list").find(".h3 span").text()) - 1)); else {
                                var i = "<p>" + t.info + "</p>";
                                $("#favirite-error .alert-con .icont-error").next().replaceWith(i), $("#favirite-error").fadeIn(200), setTimeout(function () {
                                    $("#favirite-error").fadeOut(200)
                                }, 2e3)
                            }
                        }
                    }), !1
                }
            }), $("#add-page").click(function () {
                var a = $(".fav-name").val();
                picid = $("#favirite-create #add-page").attr("data-id");
                {
                    var t = $("[data-id=" + picid + "]").eq(1);
                    t.attr("data-action")
                }
                if (0 == a.length) {
                    var i = "<p class='edit-warning' style='padding-left:0px;margin-top:0px'><i class='icon-warning'></i>名称不能为空</p>";
                    return $("#favirite-create .edit-warp").html(i), !1
                }
                if (a.length > 10 || a.length < 3) {
                    var i = "<p class='edit-warning' style='padding-left:0px;margin-top:0px'><i class='icon-warning'></i>请保持收藏夹名称3到10个字</p>";
                    return $("#favirite-create .edit-warp").html(i), !1
                }
                $("#favirite-create .fav-name").val(""), $.ajax({
                    type: "POST",
                    url: "/index.php?m=favorPage&a=save",
                    data: {name: a},
                    dataType: "json",
                    success: function (i) {
                        if (0 == i.status) $("#favirite-all").hide(), $("#favirite-null").hide(), $("#favirite-create").hide(), $.ajax({
                            type: "POST",
                            url: "/index.php?m=user&a=ajaxFav",
                            data: {action: "addFav", picid: picid, page_id: i.data},
                            dataType: "json",
                            success: function (e) {
                                if (1 == e.status) {
                                    $("#favirite-create #fav-name").attr("value", ""), t.attr("id", i.data.i);
                                    var s = "<p>成功保存到<span>" + a + "</span></p>";
                                    $("#favirite-success .alert-con .icont-true").next().replaceWith(s), $("#favirite-success").fadeIn(200), setTimeout(function () {
                                        $("#favirite-success").fadeOut(200)
                                    }, 2e3), t.children().eq(0).addClass("on"), t.children().eq(1).html(parseInt(t.children().eq(1).html()) + 1)
                                } else {
                                    var s = "<p>" + e.info + "</p>";
                                    $("#favirite-error .alert-con .icont-error").next().replaceWith(s), $("#favirite-error").fadeIn(200), setTimeout(function () {
                                        $("#favirite-error").fadeOut(200)
                                    }, 2e3)
                                }
                            }
                        }); else {
                            var e = "<p class='edit-warning' style='padding-left:0px;margin-top:0px'><i class='icon-warning'></i>" + i.info + "</p>";
                            $("#favirite-create .edit-warp").html(e)
                        }
                    }
                })
            });
            var t = !1;
            $("#favirite-all .favirite-box").unbind("scroll").bind("scroll", function () {
                var a = $("#favirite-all .fav-ajax").attr("data-id"),
                    i = parseInt($("#favirite-all").attr("data-page"));
                this.scrollHeight - 50 <= $(this).scrollTop() + $(this).height() && !t && 0 != i && (t = !0, i += 1, $("#favirite-all .list-loading").css("visibility", "initial"), $.ajax({
                    type: "GET",
                    url: "/index.php?m=favorPage&a=ajaxGetFavorPage&picid=" + a + "&page=" + i,
                    dataType: "json",
                    success: function (a) {
                        $("#favirite-all .list-loading").css("visibility", "hidden"), t = !1, parseInt(a.info) / parseInt(a.limit) > i ? $("#favirite-all").attr("data-page", i) : $("#favirite-all").attr("data-page", 0);
                        for (var e = "", s = a.data, r = 0; r < s.length; r++) {
                            var n = "", l = "";
                            1 == s[r].isFavor ? (n = "on", l = '<p class="fav-status fav-ajax" data-action="rFav"  data-id="' + s[r].id + '"><i class="icon icon-yuanxingxuanzhong"></i>已收藏</p>') : l = '<p class="fav-status fav-ajax" data-action="addFav" data-id="' + s[r].id + '"><i class="icon icon-jiahao1"></i>添加</p>';
                            var c = "background: url('" + s[r].cover_img + "') 100%;background-size:cover;";
                            e += '<li class="fav-list ' + n + '" data-id="' + s[r].id + '"><a href="javascript:;" target="_blank"><div class="bg" style="' + c + '"></div><p class="h3"><span>' + s[r].pic_num + '</span>个作品</p><p class="h1">' + s[r].name + "</p></a>" + l + "</li>"
                        }
                        $("#favirite-all .favirite-box").append(e)
                    }
                }))
            })
        })
    } catch (a) {
    }
}();
function checkURL() {
    return !0
}
function endtimecheck(e, t) {
    var i, n = 0;
    i = new Date, n = i.getTime() - e.getTime(), n /= 1e3, $.getJSON("http://ajax.58pic.com/58pic/index.php?m=tongji&a=newcount&from=newhome&type=endtime&time=" + n + "&endtype=" + t + "&callback=?", function () {
    })
}
function setCookierg(e, t, i) {
    var n = new Date;
    n.setDate(n.getDate() + i), document.cookie = e + "=" + escape(t) + (null == i ? "" : ";expires=" + n.toGMTString())
}
function getCookierg(e) {
    return document.cookie.length > 0 && (c_start = document.cookie.indexOf(e + "="), -1 != c_start) ? (c_start = c_start + e.length + 1, c_end = document.cookie.indexOf(";", c_start), -1 == c_end && (c_end = document.cookie.length), unescape(document.cookie.substring(c_start, c_end))) : ""
}
function checkCookierg() {
    if (username = getCookierg("newspeople"), null != username && "" != username) $(".newpeople").css("display", "none"), $("body").css("overflow", "visible"); else {
        var e = $("#isNoviceGuidance").val();
        if (1 == e) {
            $("body").css("overflow", "hidden"), $(".newpeople").css("display", "block");
            var t = "pv";
            $.getJSON("http://ajax.58pic.com/58pic/index.php?m=usertemp&a=index&type=" + t + "&callback=?", function () {
            })
        }
    }
}
function activityClear() {
    var e = new Date, t = e.getDate(), i = e.getMonth() + 1;
    i >= 9 && t >= 27 ? $(".activityLinks").css("display", "none") : $(".activityLinks").css("display", "block")
}
function resign() {
    var e = "click_time", t = getCookierg(e);
    if (0 > t || "" == t || 0 / 0 == t || "NaN" == t) {
        var i = parseInt(Date.parse(new Date) / 1e3);
        setCookierg(e, i)
    }
    $("#model-gift1").hide(), $(".news_gift_models").show(), $(".login-model").show()
}
function get_end_time(e) {
    var t = 1e3 * e, i = new Date(t);
    i.setDate(i.getDate() + 1);
    var n = i.Format("yyyy-MM-dd"), o = new Date(n), a = Date.parse(o), c = parseInt(a) / 1e3 - 28800;
    return c
}

require("Tpl/Public/loginRegV3"), require("Tpl/Public/rightBtnV2"), require("Tpl/Public/favorPage");

var start;
start = new Date, endtype = "exit", "" == window.document.referrer && (endtype = "jump"), $(window).unload(function () {
    endtimecheck(start, endtype)
}), window.onload = function () {
    $.getJSON("http://ajax.58pic.com/58pic/index.php?m=tongji&a=allcount&from=newhome&callback=?", function () {
    });
    var e = "{$_GET['islogin']|intval}";
    1 == e && $("#top-login").click();
    var t = $("#reg_cta");
    if (t.length) {
        var i = t.attr("data-users"), n = t.attr("data-pics");
        showRegCTA(n, i), $("#cta_box a").click(function (e) {
            e.preventDefault();
            var i = $(this).attr("id");
            $(".limitBg, .limitMain").hide();
            var n = 0;
            if ("reg_show" === i && (n = 1), $.get("http://www.58pic.com/index.php?m=index&a=delRegcta&f=" + n, function () {
                }), "reg_show" === i) {
                var o = 644, a = 534, c = ($(window).height() - a - 150) / 2, p = ($(window).width() - o) / 2;
                window.open(t.attr("data-url"), "_blank", "height=" + a + ", width=" + o + ", top=" + c + ", left=" + p + ",toolbar=no,scrollbars=no,menubar=no,status=no")
            }
            return !0
        })
    }
    var o = $(".cata-item li"), a = $(".cata-ulList .cata-list");
    o.mouseover(function () {
        var e = $(this), t = e.index();
        o.removeClass(), e.addClass("on"), a.css("display", "none"), a.eq(t).css("display", "block")
    });
    var c = new Date, p = c.getTime(), r = (p - beginTime) / 1e3;
    $("#exectime").html(" " + r + " ??");
    var s = $("#tp_cost_time").val(), d = "7";
    $.getJSON("http://ajax.58pic.com/58pic/index.php?m=ajax&a=page_cost&exec_time=" + r + "&tp_cost_time=" + s + "&type=" + b + "&servc=" + d + "&callback=?", function () {
    }), function () {
        var e = document.createElement("script");
        e.src = "//hm.baidu.com/hm.js?644763986e48f2374d9118a9ae189e14";
        var t = document.getElementsByTagName("script")[0];
        t.parentNode.insertBefore(e, t)
    }(), function () {
        var e = document.createElement("script");
        e.src = document.location.protocol + "//js.passport.qihucdn.com/11.0.1.js?1d19bbc02346c71e8fc7403d68178f67", e.id = "sozz";
        var t = document.getElementsByTagName("script")[0];
        t.parentNode.insertBefore(e, t)
    }(), function () {
        var e = document.createElement("script");
        e.src = "//push.zhanzhang.baidu.com/push.js";
        var t = document.getElementsByTagName("script")[0];
        t.parentNode.insertBefore(e, t)
    }(), $(".vip").click(function () {
        var e = "http://stats.58pic.com/58pic/index.php?m=indexdata&a=click&t=" + (new Date).getTime();
        $.getJSON(e, function () {
        })
    }), $(".clickImg").on("click", function () {
        var e = $(this).attr("data-picid");
        $.getJSON("http://ajax.58pic.com/58pic/index.php?m=tongji&a=tongjiB&bannerId=" + e + "&callback=?", function () {
        });
        var t = $(this).attr("data-kengwei");
        $.getJSON("http://ajax.58pic.com/58pic/index.php?m=tongji&a=tongjiBKeng&bannerKId=" + t + "&callback=?", function () {
        })
    }), $(".clickL").on("click", function () {
        var e = $(this).attr("data-id");
        $.getJSON("http://ajax.58pic.com/58pic/index.php?m=tongji&a=tongjiIndex&data=" + e + "&callback=?", function () {
        })
    }), $(".clickIndexAdv").on("click", function () {
        var e = $("input[name='basic_vip_tag']").val(), t = $("input[name='basic_vip_type']").val(),
            i = $(this).attr("data-id");
        $.getJSON("http://ajax.58pic.com/58pic/index.php?m=tongji&a=tongjiBasicActivityClose&source=1&vip_type=" + t + "&tag=" + e + "&data=" + i + "&callback=?", function () {
        })
    }), $(".clickHengFu").on("click", function () {
        var e = $("input[name='basic_vip_tag']").val(), t = $("input[name='basic_vip_type']").val(),
            i = $(this).attr("data-id");
        $.getJSON("http://ajax.58pic.com/58pic/index.php?m=tongji&a=tongjiBasicActivityClose&source=2&vip_type=" + t + "&tag=" + e + "&data=" + i + "&callback=?", function () {
        })
    }), $(".skip").click(function () {
        $("#popWindow").css("display", "none"), $("#maskLayer").css("display", "none"), $.getJSON("http://www.58pic.com/index.php?m=addUser&a=buchang", function () {
        })
    }), $("#close1").click(function () {
        $("#popWindow").css("display", "none"), $("#maskLayer").css("display", "none"), $.getJSON("http://www.58pic.com/index.php?m=addUser&a=buchang", function () {
        })
    }), $(document).on("click", "a", function () {
        var e = $(this).attr("href");
        if ("undefined" != typeof e) {
            for (var t = ["http://www.58pic.com", "#", "http://upload.58pic.com", "javascript:;", "javascript:void(0);", "http://gongju.58pic.com/", "##"], i = 1, n = 0; n < t.length - 1; n++)if (0 == e.indexOf(t[n]))var i = 2;
            var o = e.split("&");
            if (1 == i)return window.open("http://www.58pic.com/index.php?m=topic&a=redirye&href=" + o), !1
        }
    });
    var l = l || [];
    l.push(["set_source_id", "123456789"]), function () {
        var e = document, t = e.getElementsByTagName("head")[0], i = e.createElement("script");
        i.async = !0, i.src = "http://qzs.qq.com/qzone/biz/res/gt.js", t && t.insertBefore(i, t.firstChild)
    }()
}, $(function () {
    $(".roll-prev").on("mouseover", function () {
        var e = $(this).parent().parent().parent().attr("data-lkid");
        e = "ll-" + e, $.getJSON("http://ajax.58pic.com/58pic/index.php?m=tongji&a=tongjiIndex&data=" + e + "&callback=?", function () {
        })
    }), $(".roll-next").on("mouseover", function () {
        var e = $(this).parent().parent().parent().attr("data-lkid");
        e = "rr-" + e, $.getJSON("http://ajax.58pic.com/58pic/index.php?m=tongji&a=tongjiIndex&data=" + e + "&callback=?", function () {
        })
    }), $(".video-handle").hover(function () {
        if (0 == $(this).find("video").length) {
            var e = "<video src=" + $(this).data("video-url") + ' width="390" height="220" loop="loop" muted="muted" autoplay="autoplay" preload="none" poster=' + $(this).data("url") + "></video>";
            $(this).find("img").parent().prepend(e)
        }
        "" == $(this).find("video").attr("src") && $(this).find("video").attr("src", $(this).data("video-url"))
    }, function () {
        "" != $(this).find("video").attr("src") && $(this).find("video").attr("src", "")
    }), $(".hd-fixed2-a2").on("click", function () {
        function e(e, t) {
            var i = 2, n = new Date;
            n.setTime(n.getTime() + 60 * i * 60 * 1e3), document.cookie = e + "=" + escape(t) + ";expires=" + n.toGMTString() + "; path=/"
        }

        e("is_click_pintuan", 1), $(".hd-fixed1").show()
    }), $(".hd-fixed1-a1").on("click", function () {
        function e(e, t) {
            var i = 2, n = new Date;
            n.setTime(n.getTime() + 60 * i * 60 * 1e3), document.cookie = e + "=" + escape(t) + ";expires=" + n.toGMTString() + "; path=/"
        }

        $(".hd-fixed1").hide(), e("is_click_tone", 1)
    })
}), $(function () {
    var e = function (e) {
        var t = new RegExp("(^|&)" + e + "=([^&]*)(&|$)", "i"), i = window.location.search.substr(1).match(t);
        return null != i ? unescape(i[2]) : null
    };
    "sign" == e("active") && $(".tally-a1.sign-but").click()
}), $(".nbutton").click(function () {
    var e = $(this).attr("attr-buttype");
    $.getJSON("http://ajax.58pic.com/58pic/index.php?m=usertemp&a=index&type=" + e + "&callback=?", function () {
    })
}), $(".newpeople-one-next").click(function () {
    $(this).parent().fadeOut(300), $(".newpeople-three").fadeIn(500)
}), $(".newpeople-three-next").click(function () {
    $(this).parent().fadeOut(300), $(".newpeople-four").fadeIn(500)
}), $(".newpeople-four-next").click(function () {
    $(".newpeople").fadeOut(300), $("body").css("overflow", "visible"), setCookierg("newspeople", 100, 30)
}), $(".newpeople-close").click(function () {
    $(".newpeople").fadeOut(300), $("body").css("overflow", "visible"), setCookierg("newspeople", 100, 30)
}), $(".newpeople-four-link").click(function () {
    $(".newpeople").fadeOut(300), $("body").css("overflow", "visible"), setCookierg("newspeople", 100, 30)
}), $("body").scrollTop(1), checkCookierg(), activityClear();
var isLoginStatus = $("#isLoginHidden").val();
if (1 != isLoginStatus) {
    var qt_create_time_key = "qt_createtime", qt_create_time = getCookierg(qt_create_time_key),
        end_time = get_end_time(qt_create_time), now = parseInt(Date.parse(new Date) / 1e3);
    if (now > qt_create_time && end_time > now) {
        var key = "popupGiftShowNum", popupGiftShowNum = getCookierg(key);
        0 > popupGiftShowNum || "" == popupGiftShowNum || 0 / 0 == popupGiftShowNum || "NaN" == popupGiftShowNum ? (popupGiftShowNum = 0, setCookierg(key, popupGiftShowNum)) : popupGiftShowNum > 0 && (1 == popupGiftShowNum || 6 == popupGiftShowNum || 13 == popupGiftShowNum) ? (popupGiftShowNum = parseInt(popupGiftShowNum) + 1, setCookierg(key, popupGiftShowNum), $("#model-gift1").show()) : 16 > popupGiftShowNum && (popupGiftShowNum = parseInt(popupGiftShowNum) + 1, setCookierg(key, popupGiftShowNum))
    }
}
$("#model-gift1-close").on("click", function () {
    $("#model-gift1").hide()
}), $("#model-gift2-close").on("click", function () {
    $("#model-gift2").hide()
}), $("#model-gift3-close").on("click", function () {
    $("#model-gift3").hide()
}), $("#btn-group-gift3").on("click", function () {
    $("#model-gift3").hide()
});